export default {
  name: "ToolBar",
  data() {
    return {
      editor: {},
      editData: {}
    };
  },
  props: {},
  components: {},
  computed: {},
  watch: {},
  methods: {
    exitEditor(){
      this.editor.services.road.complete()
      this.editor.setState('none')
    }
  },
  mounted() {},
  render() {
    return (
      <div class="toolbar-container">
        <div
          class="operation"
          onClick={() => this.editor.setState("road.draw")}
        >
          <a-icon type="edit" />
          <span>绘制</span>
        </div>
        {this.editor.state === 'road.draw' ?
        <div
          class="operation exit-editor"
          onClick={this.exitEditor}
        >
          <a-button size="small">退出编辑</a-button>
        </div>
        : ''}
      </div>
    );
  }
};
